from django import forms
from django.core import validators
class MessageForm(forms.Form):
    title = forms.CharField(label="标题",max_length=120,min_length=2,
                            error_messages={"min_length":"太小了",
                                            "max_length":"太大了"}
                            )

    content = forms.CharField(label="内容",widget=forms.Textarea)
    email = forms.EmailField(label="邮箱")


class Register(forms.Form):
    ph = forms.CharField(validators=
                         [validators.RegexValidator(r"1[3-9]\d{9}",
                        message="格式不正确")])















